<?php
namespace addon\slide\validate;
use app\common\validate\ValidateBase;
class Slide extends ValidateBase
{
    // 验证规则
    protected $rule = [
        'name'              => 'require',
        'cid'               => 'require',
        'pic'               => 'require'
    ];

    // 验证提示
    protected $message = [
        'name.require'          => '幻灯片名称必须',
        'cid.require'           => '分类必须选择',
        'pic.require'           => '缩略图必须'
    ];

    // 应用场景
    protected $scene = [
        'add'  =>  ['cid','name','pic'],
        'edit'  => ['cid','name','pic'],
    ];
}